package gin_plugin

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type paramAdapter struct {
	c *gin.Context
}

func (e *paramAdapter) GetStringFromPath(name string) (string, error) {
	return e.c.Param(name), nil
}

func (e *paramAdapter) GetRequest() *http.Request {
	return e.c.Request
}

func (e *paramAdapter) GetResponseWriter() http.ResponseWriter {
	return e.c.Writer
}

func newParamAdapter(c *gin.Context) *paramAdapter {
	return &paramAdapter{c: c}
}
